{# src/Pyaf/GymBundle/Resources/views/AdminRutina/new.html.twig #}
{% extends "PyafGymBundle::layout_admin.html.twig" %}

{% block tituloSector %}<i class="icon-bookmark"></i> Rutinas - Asignar Rutinas al Calendario de Actividades{% endblock %}
{% block nombreSector %} Rutinas / Asignación de Clases{% endblock %}
{% block dashboardContent %}{% endblock %}

{% block content %}
    <div class="container-fluid" id="content-area" style="padding-right: 30px;">
        <div class="row-fluid">
            <div class="span12">
                <div class="box">
                    <div class="box-head">
                        <i class="icon-share-alt"></i>
                        <span>Asignar</span>
                    </div>
                    <div class="box-body box-body-nopadding">
                        <div class="dropdown">
                            <a href="#" class="button button-basic" data-toggle="dropdown">Paquete Rutina <span class="caret"></span></a>
                            <ul class="dropdown-menu">
                            {% for item in paquetesRutinas %}
                                {% if item.habilitado %}
                                <li>
                                    <a id="paqueteRutina-{{item.id}}">{{item.nombre}}</a>
                                </li>
                                {% endif %}
                            {% endfor %}    
                            </ul>
                                <span class="muted"><i class="icon-caret-left">  </i>     Despliegue y escoja un paquete para asignarlo al calendario!</span>
                        </div>
                        <div id="calendario" class=""></div>
                    </div>
                </div>
            </div>
        </div>
    </div>
{% endblock %}      
    
{% block javascripts %}
    <script type='text/javascript'>
        $(document).ready(function() {              
            function showCalendario(data){                
                $('#calendario').load(data);             
            };
            
            {% for item in paquetesRutinas %}            
                $('#paqueteRutina-{{item.id}}').click(function(){
                    showCalendario("{{ path('admin_calendario_show', { 'id': item.id }) }}");                
                });            
            {% endfor %}
        });
    </script>
{% endblock %}    



